package com.yml.mall.currentexception;

import com.yml.mall.enums.ResponseEnum;

/**
 * @ClassName MyException
 * @Author Administrator
 * @Date 2020/4/7   13:39
 */
public class MyException extends RuntimeException {
    Integer code;
    String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public MyException(ResponseEnum responseEnum){
        super(responseEnum.getDesc());
        this.code=responseEnum.getCode();
        this.msg=responseEnum.getDesc();
    }

    public MyException(Integer code ,String msg){
        super(msg);
        this.code=code;
        this.msg=msg;
    }
}
